﻿<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<title>智慧工地大数据中心-设备管理</title>
		<meta name="renderer" content="webkit">
		<meta name="renderer" content="webkit|ie-comp|ie-stand">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="../../resources/css/stylesheet.css">
		<link rel="stylesheet" href="../../resources/css/xadmin.css">
		<link rel="stylesheet" href="../../resources/css/main.css">
		<script type="text/javascript" src="../../resources/js/jquery.min.js"></script>
		<script type="text/javascript" src="../../resources/js/jquery.cookie.js"></script>
		<script src="../../resources/lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="../../resources/js/xadmin.js"></script>
		<script src="http://pv.sohu.com/cityjson?ie=utf-8"></script>
		<!-- 新增star -->
		<link rel="stylesheet" href="../../resources/new/css/new.css">
		<!-- 新增end -->
	</head>

	<body class="pro-bg body-bg">
		<!--头部配置结束-->
		<!--header开始-->
		<!-- 顶部开始 -->
		<header>
			<img class="head-logo" src="../../resources/images/NanJingDiTie.png" />
			<h1 class="head-title hy">智慧工地大数据中心</h1>
			<div class="pro-tips">
				<div class="tips">
					<img class="tips-img" src="../../resources/images/time.png" />
					<span class="tips-text hy" id="today">2018-11-5</span>
				</div>
				<div class="tips">
					<img class="tips-img" src="../../resources/images/local.png" />
					<span class="tips-text hy" id="citytext">长沙市</span>
				</div>
			</div>
			<div class="headlight">
				<div class="scrollNews">
					<ul>
						<li><img class="light" src="../../resources/images/light.png" /></li>
						<li><img class="light" src="../../resources/images/light.png" /></li>
					</ul>
				</div>
			</div>
		</header>
		<!-- 顶部结束 -->
		<!-- 中部开始 -->
		<div class="pro-content">
			<ul>
				<li class="menu hy">
					<a href="index.html">首&nbsp;&nbsp;页</a>
				</li>
				<li class="menu hy">
					<a href="survey.html">工程进度</a>
				</li>
				<li class="menu hy">
					<a href="panorama.html">全景监控</a>
				</li>
				<li class="menu hy">
					<a href="labor.html">劳务管理</a>
				</li>
				<li class="menu-actived hy">
					<a href="equipment.html">设备管理</a>
				</li>
				<li class="menu hy">
					<a href="environment.html">绿色施工</a>
				</li>
				<li class="menu hy">
					<a href="quality.html">基坑监测</a>
				</li>
				<li class="menu hy">
					<a href="security.html">盾构数据</a>
				</li>
				<li class="menu hy">
					<a href="../index/home.html">管理后台</a>
				</li>
			</ul>
		</div>
		<!-- 中部结束 -->
		<!-- 数据开始 -->
		<div class="data_box">
			<div class="data-left data-lr">
				<div class="scrollbar" id="left"></div>
			</div>
			<div class="data-center">
				<p class="title hy">设备监控</p>
				<div class="scrollbar">
					<div class="jiankong">
						<div class="info">
							<p class="p1 hy" id="elevatorNum">0</p>
							<p class="p2 hy">在线</p>
						</div>
						<div class="name hy">电梯（<span id="elevatorNumAll">0</span>个）</div>
					</div>
					<div class="jiankong">
						<div class="info border_green">
							<p class="p1 hy" id="craneNum">0</p>
							<p class="p2 hy">在线</p>
						</div>
						<div class="name hy">塔吊（<span id="craneNumAll">0</span>个）</div>
					</div>
				</div>
			</div>
			<div class="data-right data-lr">
				<div class="scrollbar" id="right"></div>
			</div>
		</div>
		<!-- 数据结束 -->
		<!-- 底部开始 -->
		<footer>
			<div class="footer-light">
				<div class="scrollNews">
					<ul>
						<li><img class="light" src="../../resources/images/light.png" /></li>
						<li><img class="light" src="../../resources/images/light.png" /></li>
					</ul>
				</div>
			</div>
			<div class="gear-animation">
				<img class="gearmin" src="../../resources/images/gear-min.png" />
				<img class="gearmax" src="../../resources/images/gear-max.png" />
			</div>
		</footer>
		<!-- 底部结束 -->
		<!--footer结束-->
		<script>
			var citydata = returnCitySN;
			console.log(citydata.cname);
			$("#citytext").text(citydata.cname);
			//返回对象Object {cip: "122.70.200.146", cid: "110000", cname: "北京市"}
			function load() {
				$.ajax({
					url: 'http://134.175.180.208:4001/ProjectConditionController/getEquipment',
					type: 'post',
					dataType: 'json',
					contentType: "application/json",
					async: true,
					cache: false,
					success: function(data) {
						var left = "";
						var right = "";
						$.each(data.object, function(i, item) {
							if(i == data.object.length - 1) {
								$("#elevatorNum").html(item.elevatorNum);
								$("#elevatorNumAll").html(item.elevatorNum);
								$("#craneNum").html(item.craneNum);
								$("#craneNumAll").html(item.craneNum);
							} else {
								if(i % 2 == 0) {
									left += '<div class="title">';
									left += '<p class="p1 hy">' + item.equipName + '#</p>';
									left += '<p class="p2 hy">' + item.dateTime + '</p>';
									left += '</div>';
									left += '<div class="layui-row eq_list">';
									left += '<div class="layui-col-xs4"><label>设备型号</label><span>' + item.equipType + '</span></div>';
									left += '<div class="layui-col-xs4"><label>设备编号</label><span>' + item.equipNum + '</span></div>';
									left += '<div class="layui-col-xs4"><label>备案编号</label><span>' + item.recordsNum + '</span></div>';
									left += '<div class="layui-col-xs4 active"><label>操作人员</label><span>' + item.operatePoeple + '</span></div>';
									left += '<div class="layui-col-xs4 active"><label>特种证号</label><span>' + item.cardNum + '</span></div>';
									left += '<div class="layui-col-xs4 active"><label>安装高度</label><span>' + item.installHeight + '</span></div>';
									left += '<div class="layui-col-xs4"><label>大臂长</label><span>' + item.bigLimbLength + '</span></div>';
									left += '<div class="layui-col-xs4"><label>尾臂长</label><span>' + item.endLimbLength + '</span></div>';
									left += '<div class="layui-col-xs4"><label>载重</label><span>' + item.load + '</span></div>';
									left += '<div class="layui-col-xs4 active"><label>倍率</label><span>' + item.rate + '</span></div>';
									left += '<div class="layui-col-xs4 active"><label>幅度</label><span>' + item.range + '</span></div>';
									left += '<div class="layui-col-xs4 active"><label>力矩</label><span>' + item.momental + '</span></div>';
									left += '<div class="layui-col-xs4"><label>吊钩高度</label><span>' + item.loadHookHeight + '</span></div>';
									left += '<div class="layui-col-xs4"><label>角度</label><span>' + item.angle + '</span></div>';
									left += '<div class="layui-col-xs4"><label>风速</label><span>' + item.windSpeed + '</span></div>';
									left += '<div class="layui-col-xs12 active"><label>倾角</label><span>' + item.dipAngle + '</span></div>';
									if(item.maintainState == 1) {
										left += '<div class="layui-col-xs4 plus"><label>当前维保状态</label><span>正常</span></div>';
									} else if(item.maintainState == 2) {
										left += '<div class="layui-col-xs4 plus"><label>当前维保状态</label><span class="yellow">需维保</span></div>';
									} else {
										left += '<div class="layui-col-xs4 plus"><label>当前维保状态</label><span>' + item.maintainState + '</span></div>';
									}
									left += '<div class="layui-col-xs4 plus"><label>作业计划完成度</label><span>' + item.taskRate + '%</span></div>';
									left += '</div>';
								} else {
									right += '<div class="title">';
									right += '<p class="p1 hy">' + item.equipName + '#</p>';
									right += '<p class="p2 hy">' + item.dateTime + '</p>';
									right += '</div>';
									right += '<div class="layui-row eq_list">';
									right += '<div class="layui-col-xs4"><label>设备型号</label><span>' + item.equipType + '</span></div>';
									right += '<div class="layui-col-xs4"><label>设备编号</label><span>' + item.equipNum + '</span></div>';
									right += '<div class="layui-col-xs4"><label>备案编号</label><span>' + item.recordsNum + '</span></div>';
									right += '<div class="layui-col-xs4 active"><label>操作人员</label><span>' + item.operatePoeple + '</span></div>';
									right += '<div class="layui-col-xs4 active"><label>特种证号</label><span>' + item.cardNum + '</span></div>';
									right += '<div class="layui-col-xs4 active"><label>安装高度</label><span>' + item.installHeight + '</span></div>';
									right += '<div class="layui-col-xs4"><label>大臂长</label><span>' + item.bigLimbLength + '</span></div>';
									right += '<div class="layui-col-xs4"><label>尾臂长</label><span>' + item.endLimbLength + '</span></div>';
									right += '<div class="layui-col-xs4"><label>载重</label><span>' + item.load + '</span></div>';
									right += '<div class="layui-col-xs4 active"><label>倍率</label><span>' + item.rate + '</span></div>';
									right += '<div class="layui-col-xs4 active"><label>幅度</label><span>' + item.range + '</span></div>';
									right += '<div class="layui-col-xs4 active"><label>力矩</label><span>' + item.momental + '</span></div>';
									right += '<div class="layui-col-xs4"><label>吊钩高度</label><span>' + item.loadHookHeight + '</span></div>';
									right += '<div class="layui-col-xs4"><label>角度</label><span>' + item.angle + '</span></div>';
									right += '<div class="layui-col-xs4"><label>风速</label><span>' + item.windSpeed + '</span></div>';
									right += '<div class="layui-col-xs12 active"><label>倾角</label><span>' + item.dipAngle + '</span></div>';
									if(item.maintainState == 1) {
										right += '<div class="layui-col-xs4 plus"><label>当前维保状态</label><span>正常</span></div>';
									} else if(item.maintainState == 2) {
										right += '<div class="layui-col-xs4 plus"><label>当前维保状态</label><span class="yellow">需维保</span></div>';
									} else {
										right += '<div class="layui-col-xs4 plus"><label>当前维保状态</label><span>' + item.maintainState + '</span></div>';
									}
									right += '<div class="layui-col-xs4 plus"><label>作业计划完成度</label><span>' + item.taskRate + '%</span></div>';
									right += '</div>';
								}
							}
						});
						$("#left").html(left);
						$("#right").html(right);
					},
					error: function(data) {
						alert("设备数据获取失败");
					}
				});
			};
			$(function() {
				load();
				setInterval(load, 600000);
				var Windows_H = document.documentElement.clientHeight;
				var Data_H = Windows_H - 240;
				$(".data-lr").css("height", Data_H);
				$(".data-center").css("height", Data_H + 10);
				$(window).resize(function() {
					window.location.reload()
				});
			});
		</script>
	</body>

</html>